package com.ylr.blog.framework.mapper;

import com.ylr.blog.framework.entity.AuditBlogEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-05-19 20:35:21
 * className: AuditBlogMapper
 * version: 1.0
 * description:
 */
public interface AuditBlogMapper extends BaseMapper<AuditBlogEntity> {

    /**
     * 查询博客最大审核版本号
     * @param blogId       博客主键
     * @param deleteStatus 删除状态
     * @return 最大版本号
     */
    Integer selectMaxVersion(@Param("blogId") Long blogId, @Param("deleteStatus") Integer deleteStatus);

    /**
     * 查询待审核博客的最新一条数据
     * 版本号最高的数据
     * @param blogId       博客主键
     * @param deleteStatus 删除状态
     * @return 待审核博客对象
     */
    AuditBlogEntity selectLastOne(@Param("blogId") Long blogId, @Param("deleteStatus") Integer deleteStatus);

}
